static char SccsId[] = "@(#)spquad.c	1.5   10/2/95";
/*
 *         Copyright (c) KUBOTA Corporation and HUDSON SOFT,
 *                  1994, 1995 All Rights Reserved
 *
 *  This software comprises unpublished confidential information of
 *  KUBOTA Corp. and HUDSON SOFT. It may not be used, copied or made
 *  available to anyone, except in accordance with the license under
 *  which it is furnished.
 */

#define	ASL_USE_MACRO

#undef	H_FLIP
#undef	V_FLIP

#include <farl.h>
#include <asl.h>

void
main()
{
	ASLSct		sct;
	ASLPt		pt[64];
	ASLSource	src;
	ASLQuadrangleParameter	param;
	Bool		hFlip, vFlip;
	int		i;

	FX73init();
	FX73_cmap_i5c4();
	FarlInit();
	ASLSetSpriteWindow( 0, 0, 255, 239 );
	src.bank    =   0;
	src.x_pos   = 192;
	src.y_pos   = 128;
	src.x_size  =  64;
	src.y_size  =  64;
	src.x_hot   =  32;
	src.y_hot   =  32;

#if defined( H_FLIP )
	hFlip	    = True;
#else
	hFlip	    = False;
#endif
#if defined( V_FLIP )
	vFlip	    = True;
#else
	vFlip	    = False;
#endif

	for (;;) {
		for ( i = 0; i <  32; i++ ) {
			param.dstXt = 96 + i;
			param.dstWt = 64 - i * 2;
			param.dstXb = 96;
			param.dstWb = 64;
			param.dstY  = 96 + i * 2;
			param.dstH  = 64 - i * 2;
			param.ptBank	= 2;
			param.ptOffAddr	= 0;
			ASLMakeQuadrangleSprite( &src, &param, pt, &sct );
			ASLChangeHVFlip( &sct, hFlip, vFlip );
			ASLSetSpriteTable( 1, 0, 1, &sct );
			ASLSetParameterTable( 2, 0, 64, pt );
			ASLExecuteSprite( 1, 0, 1 );

			/*	Swap buffer.	*/
			ASLSync();
			FarlSwapWindow();
			ASLWaitForSwap();
		}
		for ( i = 31; i >  0; i-- ) {
			param.dstXt = 96 + i;
			param.dstWt = 64 - i * 2;
			param.dstXb = 96;
			param.dstWb = 64;
			param.dstY  = 96 + i * 2;
			param.dstH  = 64 - i * 2;
			param.ptBank	= 2;
			param.ptOffAddr	= 0;
			ASLMakeQuadrangleSprite( &src, &param, pt, &sct );
			ASLChangeHVFlip( &sct, hFlip, vFlip );
			ASLSetSpriteTable( 1, 0, 1, &sct );
			ASLSetParameterTable( 2, 0, 64, pt );
			ASLExecuteSprite( 1, 0, 1 );

			/*	Swap buffer.	*/
			ASLSync();
			FarlSwapWindow();
			ASLWaitForSwap();
		}
	}
}

